package pers.warren.ai.run.controller;


import lombok.RequiredArgsConstructor;
import org.reactivestreams.Publisher;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.warren.ai.oneapi.OneApiProxy;

@RequiredArgsConstructor
@RestController
public class GptController {


    private final OneApiProxy proxy;


    @RequestMapping("/v1/chat/completions")
    public Publisher<String> chatCompletions(@RequestBody Prompt prompt){
        return proxy.chatCompletions(prompt);
    }
}
